package com.zyj.excelhandler;

import com.zyj.common.utils.CacheUtils;
import com.zyj.common.utils.poi.ExcelHandlerAdapter;
import com.zyj.common.utils.spring.SpringUtils;
import com.zyj.supplier.domain.AsstesSupplier;
import com.zyj.supplier.service.IAsstesSupplierService;
import com.zyj.supplier.service.impl.AsstesSupplierServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * Created by Administrator on 2022/5/23.
 */
public class SupplierHandler implements ExcelHandlerAdapter {

    private IAsstesSupplierService supplierService = SpringUtils.getBean(AsstesSupplierServiceImpl.class);

    @Override
    public Object format(Object value, String[] args)
    {
        String name = "";
        AsstesSupplier supplier = supplierService.selectAsstesSupplierBySupplierId(Long.parseLong((String)value));
        if(supplier!=null){
            name = supplier.getSupplierName();
        }else{
            name = value+"";
        }
        System.out.println(name);
        return name;
    }
}
